<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        document.onclick=function(){
//            现在的高级浏览器FF Chrome都兼容
          alert(document.documentElement.scrollTop);
//
//          alert(document.body.scrollTop);
        };
    </script>
</head>
<body style="height:2000px;">

</body>
</html>